#include<bits/stdc++.h>
#define mod 998244353
#define int long long
#define rep(i,a,b) for(int i(a);i<=(b);++i)
#define req(i,a,b) for(int i(a);i>=(b);--i)
#define sort stable_sort
using namespace std;
char buf[1<<23],*p1=buf,*p2=buf,ubuf[1<<23],*u=ubuf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template<typename TP> inline TP read(TP &num)
{
	TP x=0;
	int f=0;
	char ch=getchar();
	while(ch<48||ch>57) f|=ch=='-',ch=getchar();
	while(48<=ch&&ch<=57) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return num=f?-x:x;
}
template<typename ...Args> inline void read(Args &...args)
{
	(read(args),...);
}
template<typename TP> inline void write(TP x)
{
	(x<0)?(putchar('-'),x=-x):0;
	(x>9)?(write(x/10),0):0;
	putchar((x%10)^48);
}
template<typename TP> inline void writeln(TP x)
{
	write<TP>(x);
	puts("");
}
int n,m,k,siz,x,y,OH;
basic_string<int> g[7];
inline int SHIT(int FUCK,int CCF)
{
	int FUCKCCF=1;
	while(CCF)
	{
		if(CCF&1) FUCKCCF=FUCKCCF*FUCK%mod;
		FUCK=FUCK*FUCK%mod;
		CCF>>=1;
	}
	return FUCKCCF;
}
int COL[7];
signed main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	read(n,m,k,siz); vector<int> s(siz+1,0),col(siz+1,0); rep(i,1,siz) read(s[i]);
	rep(i,1,n-1) read(x,y),g[x]+=y,g[y]+=x;
	int TOT=SHIT(m,n);
	rep(stat,0,TOT-1)
	{
		fill(col.begin(),col.end(),0); int CQBS=stat;
		rep(i,1,n) COL[i]=CQBS%m+1,CQBS/=m;
//		cout<<"COLOR WAY:";rep(i,1,n)cout<<COL[i]<<" ";cout<<endl;
		queue<pair<int,int>> q; q.emplace(1,0);int ok=1;
		while(!q.empty())
		{
			auto [x,fa]=q.front();q.pop();for(auto y:g[x]) if(y!=fa)
			{
				if(COL[x]==COL[y])
				{
//					cout<<"COLOR OF "<<x<<" /*DIFFERS*/ REPEATS FROM "<<y<<"'S, COLOR WAY: ";rep(i,1,n)cout<<COL[i]<<",";cout<<endl;
					ok=0;break;
				}
				q.emplace(y,x);
			}
			if(!ok) break;
		}
		if(!ok)continue;
		set<int> BSZX;
		rep(i,1,siz) BSZX.emplace(COL[s[i]]);
		OH=(OH+SHIT(BSZX.size(),k))%mod;
	}
	writeln(OH);
	return 0;
}
